const state = {
  info: null,
  changeInfo: null,
};

const mutations = {
  setInfo(state, info) {
    state.info = info;
  },
  setChangeInfo(state, changeInfo) {
    state.changeInfo = changeInfo;
  },
};

const actions = {
  setInfo({ commit },info) {
    commit("setInfo", info);
  },
  setChangeInfo({ commit },changeInfo) {
    commit("setChangeInfo", changeInfo);
  },
};

const getters = {
  getInfo: (state) => state.info,
  getInfoByKey: (state) => (key)=>state.info[key],
  getChangeInfo: (state) => state.changeInfo,
  getChangeInfoByKey: (state) => (key)=>state.changeInfo[key],
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
};
